/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vn.ikame.android.utils;

import android.app.Activity;
import android.content.SharedPreferences;

/**
 * 
 * @author KienVN
 */
public class CStore {
	SharedPreferences prefs;
	private SharedPreferences.Editor editor;
	private boolean purchase;
	private boolean showAbout;

	public CStore(Activity activity) {
		prefs = activity.getPreferences(android.content.Context.MODE_PRIVATE);
		this.editor = prefs.edit();
		LoadData();
	}

	private void LoadData() {
		purchase = prefs.getBoolean("purchaseFMA", false);
		showAbout = prefs.getBoolean("showAbout", false);
	}

	private void Save() {
		editor.putBoolean("purchaseFMA", purchase);
		editor.putBoolean("showAbout", showAbout);
		editor.commit();
	}

	
	public void setPurchase(boolean purchase) {
		this.purchase = purchase;
		Save();
	}

	public boolean isPurchase() {
		return this.purchase;
	}

	public boolean isShowAbout() {
		return showAbout;
	}

	public void setShowAbout(boolean showAbout) {
		this.showAbout = showAbout;
		Save();
	}

	
}
